<%@page import="lbsproject.processaudit.model.enumeration.Gender"%>
<%@page import="lbsproject.processaudit.model.Worker"%>
<%@page import="lbsproject.processaudit.model.WorkerPosition"%>
<%@page import="lbsproject.processaudit.model.WorkRegion"%>
<%@page import="web.lbsproject.processaudit.model.WorkRegion4Web"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- Begin: WEB-INF/template/taskManage/addPeople/newPostPerson.jsp -->
<p>
<strong>修改操作人员</strong>
</p>
<!-- 新增人员form的表格 -->
<form action="AddPeople?mode=edit" method="post">
	<%
	Worker worker = (Worker)request.getAttribute("editWorker");
	%>
	<input type="hidden" name="workerID" value="<%=worker.getWorkerID() %>"/>
	<label for="name">名字：</label><input type="text" name="name" value="<%=worker.getName() %>" id="name" class="input"/>
	<em>（不能与已有人员重名）</em>
	<br/>
	<label for="pass">密码：</label><input type="text" name="pass" value="<%=worker.getPassword() %>" id="pass" class="input"/>
	<br/>
	<label for="position">岗位：</label>
	<%
	@SuppressWarnings("unchecked")
	List<WorkerPosition> allPositions = (List<WorkerPosition>)request.getAttribute("allWorkerPositions");
	final String checked = "checked=\"checked\"";
	for (WorkerPosition pos: allPositions) {
		String isChecked;
		if (pos.getPositionId().equals(worker.getPosition().getPositionId())) {
			isChecked = checked;
		} else {
			isChecked = "";
		}
	%>
		<input type="radio" name="position" value="<%=pos.getPositionId() %>" <%=isChecked %> /><%=pos.getPositionName() %>
	<%
	}
	%>
	<br/>
	<label for="gender">性别：</label>
	<%
	String maleChecked = "";
	String femaleChecked = "";
	if (worker.getGender() == Gender.MALE)
		maleChecked = checked;
	else
		femaleChecked = checked;
	%>
	<input type="radio" name="gender" value="MALE" <%=maleChecked %> />男
	<input type="radio" name="gender" value="FEMALE" <%=femaleChecked %>/>女
	<br/>
	<label for="contact">联系方式：</label><input type="text" name="contact" value="<%=worker.getContact() %>" id="contact" class="input"/>
	<br/>
	<input type="submit" value="修改"/>
</form>
<br/>

<div class="blank"></div>

<!-- 展示已存在的工作人员 -->

<jsp:include page="existedWorkers.jsp"/>

<!-- End -->